package com.ming.interview;

import java.util.Scanner;

/**
 * @Description 输入一行字符，分别统计出其英文字母、空格、数字和其它字符的个数。
 * @Author ye.ming
 * @Date Created in 2019/8/26
 */
public class Main6 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String line = sc.nextLine();
        char[] array = line.toCharArray();
        int letters = 0;
        int spaces = 0;
        int others = 0;
        int nums = 0;

        for (int i = 0; i < array.length; i++) {
            if (array[i] >= 48 && array[i] <= 57) {
                nums++;
            } else if (array[i] == 32) {
                spaces++;
            } else if ((array[i] >= 65 && array[i] <= 90) || (array[i] >= 97 && array[i] <= 122)) {
                letters++;
            } else {
                others++;
            }
        }

        System.out.println(String.format("字母的个数：%d，空格的个数：%d，数字的个数：%d，其他字符的个数：%d。",letters,spaces, nums, others));
        sc.close();

    }


    private static void m1(int m, int n) {

    }


}
